package com.example.seckill.Exception;

public enum ErrorEnum {
    //通用
    SUCCESS(200, "SUCCESS"),
    ERROR(500, "服务端异常"),

    NO_TOKEN_FOUND(401,"用户未登录或登录过期，请登录" ),
    ILLEGAL_TOKEN(401,"非法令牌"),
    EXPIRED_TOKEN(401,"令牌已过期，请重新登录" ),
    ROLE_LIMIT(402,"用户无访问权限,请联系管理员"),

    //登录模块
    LOGIN_ERROR(500210, "用户名或者密码不正确"),
    REPEAT_USERNAME(500211,"用户名已存在" ),

//    MOBILE_ERROR(500211, "手机号码格式不正确"),
    BIND_ERROR(500212, "参数校验异常"),
    NO_USER_FOUND(500214,"用户不存在" ),
//    MOBILE_NOT_EXIST(500213, "手机号码不存在"),
//    PASSWORD_UPDATE_FAIL(500214, "更新密码失败"),
//    SESSION_ERROR(500215, "用户SESSION不存在"),

    //查找宿舍

    NO_BUILDING_FOUND(500400,"不存在宿舍楼"),
    NO_ROOM_FOUND(500401,"不存在房间"),
    NO_EVENT_FOUND(500402,"暂无选宿舍活动"),
    NO_ORDER_FOUND(500403,"暂无订单" ),
    NO_BED_FOUND(500404,"不存在床位" ),


    //秒杀活动

    //预订模块
    EMPTY_STOCK(500500, "库存不足"),
    REPEATE_ERROR(500501, "学生已分配宿舍"),
    REQUEST_ILLEGAL(500502, "请求非法，请重新尝试"),
    GENDER_ILLEGAL(500503,"性别不一致，请选择其他宿舍"),
    ACCESS_LIMIT_REACHED(500504, "访问过于频繁，请稍后重试"),
    ERROR_CAPTCHA(500505, "验证码过期或错误，请刷新后重新输入"),
    INCOMPLETE_INFO(500506, "用户信息不全"),
    TIME_ILLEGAL(500507,"活动时间不合法，请确保结束时间晚于开始时间,且二者皆晚于当前时间"),
    DISTRIBUTED_BED(500508,"床位已分配，不允许随意修改状态" );
//    //订单模块5003xx
//    ORDER_NOT_EXIST(500300, "订单不存在"),





    private final Integer code;
    private final String message;

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    ErrorEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
